import request from '@/utils/request'

// 某一频道的列表的详细数据相关的接口
export interface HomeListCategoryModel {
    id: number,
    superCategoryId: number,
    showIndex: number,
    name: string,
    frontName: string,
    frontNameIcon: null,
    frontDesc: string,
    level: string,
    wapBannerUrl: string,
    type: number,
    categoryType: number,
}
export interface ItemModel {
    id: number,
    listPicUrl: string,
    name: string,
    seoTitle: string,
    simpleDesc: string,
    primaryPicUrl:string,
    primarySkuId: number,
    retailPrice: number,
    counterPrice: number,
    sortOriginPrice: number,
}
export interface CategoryItemModel {
    category: HomeListCategoryModel,
    itemList:ItemModel[]
}
export type CategoryItemListModel = CategoryItemModel[]

// 轮播图相关数据接口
export interface OtherChannelExtra {
    crmUserGroupId: string
    crmUserGroupName: string
    itemFrom: number
    materialContentFrom: number
    materialId: string
    materialName: string
    materialType: string
    rcmdSort: boolean
    resourcesId: number
    taskId: string
    taskType: number
}

export interface OtherChannel {
    extra: OtherChannelExtra
    id: number
    picUrl: string
    targetUrl: string
}

export type OtherChannelList = OtherChannel[]

export default {
    // 获取某个频道的数据
    getOneChannel(categoryId: number) {
        return request.get(`/wyyx/item/list.json?__timestamp=1630136511866&categoryId=${categoryId}`)
    },
}